﻿@using Lari.Configuration
@using Lari.Web.Utility
@model Lari.Services.ViewModel.UserMapModel
<div id="pagetitle">
	<h1>@ScreenName.Users.CreateLogingUser</h1>
</div>
<div class="spacer">
</div>
<div id="pagecontent">
	<div class="tab">
		Employee Details</div>
	<div class="tabContent">
	  @Html.Partial("_EmployeeView",Model.EmployeeModel)
	   
	</div>
	@if (!Model.UserIsMapped)
	{
		<div style="width: 50%">
			@using (Html.BeginForm())
			{
				@Html.AntiForgeryToken("createuser")
				<fieldset>
					<legend>login Details</legend>
					<div>
						<label class="required">
							User Id</label>
					</div>
					<div>
						@Html.TextBoxFor(m => m.UserId)
						@Html.HiddenFor(m => m.UserIsMapped)
						@Html.HiddenFor(m => m.EmpId)
					   
					</div>
					 <div>@Html.ValidationMessageFor(m => m.UserId)</div>
					<div class="spacer">
					</div>
					<div>
						<label class="required">
							Password</label>
					</div>
					<div>
						@Html.PasswordFor(m => m.Password)
					</div>
					<div>@Html.ValidationMessageFor(m => m.Password)</div>
					<div class="spacer">
					</div>
					<div>
						<label class="required">
							Confirm Password</label>
					</div>
					<div>
						@Html.PasswordFor(m => m.ConfirmPassword)
					</div>
					<div>@Html.ValidationMessageFor(m => m.ConfirmPassword)</div>
					<div class="spacer"></div>
					<div>
						<label class="required">
							Role</label>
					 </div>
					<div>
						@Html.DropDownListFor(m => m.RoleId, this.ToListItems(LookupEnum.Role))
					</div>
					<div>
					  @Html.ValidationMessageFor(m => m.RoleId)
					  </div>

					<div class="doubleSpacer">
					</div>
					<div>
						<input type="submit" value="Create User" id="btnCreateUser" />
					</div>
				</fieldset>
			}
		</div>
	}
	else
	{
		<div class="spacer">
		</div>  
		@Html.Partial("_DisplyMessaage", MessageCode.User.EmployeeIsMapedWithUser)
		 
	}
	<div class="spacer">
	</div>
	<div>@Html.ActionLink("Back to Employee Details", ActionConst.Users.ViewEmployee, new { id = Model.EmpId })</div>
	<div class="spacer">
	</div>
</div>
<script type="text/javascript">

	$(document).ready(function () {
		$("#btnCreateUser").button();
	});
</script>
